#include "utility.h"



using namespace std;

string readString (fstream &file) {
	string s;
	char buf;
	do {
		file.get(buf);
		if (file.eof() || buf=='\n' || buf==' ' || buf=='\t')
			break;
		s.append(1,buf);
	} while (true);
	return s;
}

unsigned int randomize (unsigned maxVal) {
	return rand()%maxVal;
}

unsigned int randomBetween (unsigned minVal, unsigned maxVal) {
	unsigned result = rand()%(maxVal+1);
	while (result < minVal) result = rand()%maxVal;
	return result;
}

unsigned int randomVectorElement (vector<int> &vettore) {
	unsigned index = randomize(vettore.size());
	return vettore[index];
}

void exeStop() {		// execution stop
	cout << endl << "Premi per continuare" << endl;
	cin.ignore();
}

